limit string syntax

33

<?php
      $string = "How to Limit Characters to Display in a String using PHP";
      echo substr($string, 0, 30);
?>
<?php
       $string = "How to Limit Characters to Display in a String using PHP";
       echo substr_replace($string, '...', 25);
?>

Comments

Submit
0 Comments